package com.hncic.tx.center.dao;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import com.hncic.tx.center.common.model.TickerHot;

/**
 * 
 * @author smj
 *
 */
@Repository
public class TickerHotDao {

	private static final RowMapper<TickerHot> tickerHotRM = BeanPropertyRowMapper
			.newInstance(TickerHot.class);

	private Logger logger = LoggerFactory.getLogger(getClass());

	private @Autowired JdbcTemplate jdbcTemplate;

	// private @Autowired NamedParameterJdbcTemplate namedParameterJdbcTemplate;

	public TickerHot getById(Integer id) {
		logger.info("sdkfhhfdshfksdhkfshdkfhsdkf:{}", "info...........");
		logger.warn("sdkfhskdhf:{}", "warn......");
		return jdbcTemplate.queryForObject(sql.GETBYID, tickerHotRM, id);
	}

	private static class sql {
		private final static String GETBYID = "select  234423 as id from dual where 1 = ?";

	}

}